import fs from 'fs';

type Data = {
  path: string;
  content: string;
};
export default (e: Electron.IpcMainEvent, data: string | Data) => {
  console.log('data=', data);
  if (typeof data === 'string') {
    data = JSON.parse(data) as Data;
    fs.writeFileSync(data.path, data.content);
  }
};
